#!/bin/bash

set -e -u

ROOT=$(cd $(dirname $0)/.. && pwd)

DEVDIR=/tmp/concourse-dev
DBDIR=$DEVDIR/db

[ -d $DBDIR ] || initdb -U postgres -D $DBDIR -E UTF8 --no-local

postgres -D $DBDIR -h 127.0.0.1 -p ${POSTGRES_PORT:-6543} "$@"
